﻿<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>


   

<div class="box-main">

        <div class="box-main">

            <div class="box-main-left">
                <div class="pro-content">
                    <div class="box-pro-highlights">
                         <div class="site_map" align="left">Trang chu <img src="/onlinemarket/img/navbit-arrow-right.png"/> Hoa don</div>
						
    <div class="heading">
        <div class="heading_left"></div>
        <div class="heading_right"></div>
        <div class="heading_center">
        	<h3>Hoa don</h3>
        </div></div>
                        <div class="content">
                            <div align=center>
                              <table class="myTable" style=""> 
							  <tr>
								<th>Hóa đơn số</th>
								<th>Khách hàng</th>
								<th>Sản Phẩm</th>
								<th>Số lượng</th>
								<th>Đơn giá</th>
								<th>Ngày lập</th>
								<th>Thành tiền</th>
							  </tr>
							  <tr>
							  <?php
											foreach($orderdetail as $orderdt){
												if($orderdt['Orderdetail']['order_id']==$oders['Order']['id']){
									?>
							     <td>
									<span style="color:#a11818;font-weight: normal">
                                      <?php  echo($oders['Order']['id']); ?>
                                     </span>
							     </td>
								 <td>
									<span style="color:#a11818;font-weight: normal">
                                      <?php
										foreach($customersi  as $customer){
										if($customer['Customer']['id']== $oders['Order']['customer_id']){
										echo($customer['Customer']['lastname']);
										echo(" " .$customer['Customer']['firstname']);
										}
										}
										?>
                                     </span>
							     </td>
								  
								<td>
									<span style="color:#a11818;font-weight: normal">
									<?php 
										foreach($productsi  as $product){
										if($product['Product']['id']== $orderdt['Orderdetail']['product_id']){
										echo($product['Product']['name']);
										}
										}
									?>
                                     </span>
							     </td>
								 <td>
									<span style="color:#a11818;font-weight: normal">
									<?php echo($orderdt['Orderdetail']['quantity']); ?>
                                     </span>
							     </td>
							     <td>
									<span style="color:#a11818;font-weight: normal">
									<?php echo(number_format($orderdt['Orderdetail']['value'],0,'.','.'));  ?>
                                     </span>
							     </td>
								
								 <td>
									<span style="color:#a11818;font-weight: normal">
                                      <?php  echo($oders['Order']['date']); ?>
                                     </span>
							     </td>
								 <td>
									<span style="color:#a11818;font-weight: normal">
                                      <?php
										$qty=$orderdt['Orderdetail']['quantity'];
										$gia =$orderdt['Orderdetail']['value'];
										
									  echo(number_format($qty*$gia,0,'.','.')); ?>
                                     </span>
							     </td>
							     </tr> <?php } }?>
								</table>
                                                     
                            </div>
                            <script>
                                function onEdit(link) {
					
                                    window.location = ""+link;
                                }
                            </script>
                        </div>
                    </div>
                </div><!--end div.box-pro-highlights-->
            </div><!--end div.pro-content-->
        </div><!--end div.box-main-left-->
        <div class="box-main-right" style="margin: 0px;"></div><!--end div.box-main-right-->

    </div><!--end div.box-main-->

    <div class="box_footer">

    </div><!--end div.footer-->
</body>
</html>